-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add basic nested hyperv on kvm test case #3723
Conversation
Signed-off-by: lixuemin2016 [email protected] |
ef9b698
to
6725efa
Compare
Tested on a host with Haswell CPU, it can be passed. Tested with Win2019 guest os, commands as: (1/2) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: STARTED CPU flags as: |
@lixuemin2016 For commit log, you can add some description for this fix, It's more helpful for others to understand this patch~ |
@peixiu thank you so much, Peixiu, updated with more descriptions in the commit log.
Test pass for win2022,2019,2016,win10 Gen1/Gen2 VM. For win11, after enable Hyper-V role in L1, it cannot boot up with cpu flags as below: |
close by mistake :) |
Test result for w2022 for example: JOB LOG : /root/avocado/job-results/job-2023-06-01T14.34-63165d4/job.log |
@YongxueHong Could you please help to review this PR? Thank you so much. |
@@ -0,0 +1,16 @@ | |||
- nested_hyperv_on_kvm: | |||
type = nested_hyperv_on_kvm | |||
download_url = "https://fedora.mirror.constant.com/fedora/linux/releases/37/Cloud/x86_64/images/Fedora-Cloud-Base-37-1.7.x86_64.qcow2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
download_url = "https://fedora.mirror.constant.com/fedora/linux/releases/37/Cloud/x86_64/images/Fedora-Cloud-Base-37-1.7.x86_64.qcow2" | |
download_url = "" |
It looks like this link is a private site we can not expose it in public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, changed. Thank you for reminder. Even this URL can be accessed from public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YongxueHong Hi Yongxue,
Thank you so much for your review and reminder, all the suggestions have been updated.
Best Regards,
Xuemin
Hi, @lixuemin2016 |
6f7fb53
to
51b2323
Compare
Hi Yihuang, Yongxue, I have updated this PR based on Yongxue's suggestion. Could you please help to take a look again at this PR when you get time? Best Regards, |
qemu/tests/nested_hyperv_on_kvm.py
Outdated
get_vhdx() | ||
|
||
need_reboot = 0 | ||
status, output = session.cmd_status_output("powershell Get-VM \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status, output = session.cmd_status_output("powershell Get-VM \ | |
status = session.cmd_status("powershell Get-VM \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulYuuu Updated, thank you so much for your comment.
qemu/tests/nested_hyperv_on_kvm.py
Outdated
hyperv_source = os.path.join(data_dir.get_deps_dir(), "nested_hyperv") | ||
vm.copy_files_to(hyperv_source, nested_dest) | ||
|
||
# set ExecutionPolicy mainly for winows 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check Win version first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulYuuu
Thank you so much for review.
Change the description to "set RemoteSigned policy mainly for windows 10/11, it is default for windows server". This powershell command "Set-ExecutionPolicy" can be executed to windows server (2016/2019/2022), and windows 10/11.
For windows server 2016/2019/2022, the default policy is 'RemoteSigned', after execute the command, it does not have side effect. For windows 10/11, the default is undefined, so must execute this command.
==============================================================================
Refer to https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.3.
RemoteSigned
The default execution policy for Windows server computers.
Undefined
There is no execution policy set in the current scope.
If the execution policy in all scopes is Undefined, the effective execution policy is Restricted for Windows clients and RemoteSigned for Windows Server.
Thank you so much.
Xuemin
@@ -0,0 +1,15 @@ | |||
- nested_hyperv_on_kvm: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider only x86_64
and only Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thank you so much for your comment @PaulYuuu
1. Start L1 Windows VM (w2022,2019,2016,win10) 2. Start L2 BIOS/UEFI VM via booting up fedora image ID: 2219365 Signed-off-by: xuemin <[email protected]>
qemu/tests/nested_hyperv_on_kvm.py
Outdated
import time | ||
import os | ||
from avocado.utils import download | ||
from avocado.utils import process | ||
from virttest import data_dir | ||
from virttest import error_context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import time | |
import os | |
from avocado.utils import download | |
from avocado.utils import process | |
from virttest import data_dir | |
from virttest import error_context | |
import time | |
import os | |
from avocado.utils import download | |
from avocado.utils import process | |
from virttest import data_dir | |
from virttest import error_context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Signed-off-by: lixuemin2016 [email protected]